// 服务注册表（单例）
class ServiceRegistry {
  private static instance: ServiceRegistry
  private services: Map<string, any> = new Map()

  static getInstance(): ServiceRegistry {
    if (!ServiceRegistry.instance) {
      ServiceRegistry.instance = new ServiceRegistry()
    }
    return ServiceRegistry.instance
  }

  register<T>(serviceName: string, instance: T): void {
    this.services.set(serviceName, instance)
  }

  resolve<T>(serviceName: string): T {
    const service = this.services.get(serviceName)
    if (!service) throw new Error(`Service ${serviceName} not registered`)
    return service as T
  }
}

// 初始化服务注册（应用启动时执行）
// const registry = ServiceRegistry.getInstance();
// registry.register("IBizService", new BizService());
// registry.register("IStructureService", new StructureService());
// registry.register("IBQItemService", new BQItemService());
// registry.register("ILmmDetailService", new LmmDetailService());
